package company.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import company.common.R;
import company.domain.Activities;
import company.domain.Lost;
import company.domain.Lostpets;
import company.service.LostService;
import company.service.LostpetsService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@RestController
public class LostController {

    @Resource
    LostpetsService lostpetsService;

    @Resource
    LostService lostService;

    /*
    * 连表查询
    * */
    @RequestMapping("/selectLost")
    public R selectLost(){
        List<Map> list = lostService.selectlost();
        return new R().add("list",list);
    }
    /*
     * 根据id查询
     * */
    @PostMapping("/selectlostpetsbyid")
    public R selectLostbyid(@RequestBody Lostpets lostpets){
        Lostpets byId = this.lostpetsService.getById(lostpets.getPetid());
        return new R().add("byId",byId);
    }

}
